<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/12/5
 * Time: 11:27
 */

$pow = pow( 10, 10 );
echo $pow.PHP_EOL;

$pow = pow(5,2);
echo $pow.PHP_EOL;

$test_ids = array(1,9,10,99,100,999,1000,1009,2099,3999,9999,14999,99999);
foreach ($test_ids as $val) {
	$division = (int) ( $val / pow( 10, 3 ) );
	$word     = "";
//	echo $division.PHP_EOL;
	while ( $division ) {
		$tmp = fmod( $division, 26 ); // 只使用26个大写字母
		$tmp = chr( $tmp + 65 );      // 转为字母
		$word .= $tmp;
		$division = floor( $division / 26 );
//		echo $division.PHP_EOL;
		echo $word . PHP_EOL;
	}
	if ( $word == '' ) {
		echo chr( 65 ) . PHP_EOL;
	}
}

exit(12121212);